{include file="admin/top.php" subject='moving'}
{include file="moving/top.php" subject='moving'}
<div id="content">
{rights right='moving_create'}<ul id="addmenu"><li style="display: inline;"><a href="{$site_admin}m=inventory&s=moving.php&uri=create">添加调拨单</a></li></ul>{/rights}
    <div id="boxquery">
    <form method="get">
    	<input type="hidden" name="m" value="inventory" />
        <input type="hidden" name="s" value="moving.php" />
        <input type="submit" value="提交" class="fr" />
        <li>
        	调拨单ID:&nbsp;<input name="paper_id" value="{$smarty.get.paper_id}"/>
        </li>
        <li>仓库:&nbsp; <select id="shopid_from" name="shopid_from"><option></option>{shops}<option value="{$shops.id}" {if $shops.id==$smarty.get.shopid_from}selected{/if}>{$shops.title}</option>{/shops}</select>
        -> <select id="shopid_to" name="shopid_to"><option></option>{shops}<option value="{$shops.id}" {if $shops.id==$smarty.get.shopid_to}selected{/if}>{$shops.title}</option>{/shops}</select></li>
        <li class="yui-skin-sam">时间:&nbsp; 
            <input id="sdate" name="sdate" type="text" size="12" value="{$smarty.get.sdate}" onfocus="lockinput(this)" />
            <input id="edate" name="edate" type="text" size="12" value="{$smarty.get.edate|default:$smarty.now|date_format:'%Y-%m-%d'}" onfocus="lockinput(this)" />
            <div id="calContainer" style="display:none; position:absolute;"></div>
        </li>
    </form>
    </div>

    <table width="100%" border="0" cellspacing="0" cellpadding="5" id="lister">
      <tr id="title">
        <td width="40">ID</td>
        <td>仓库</td>
        <td>调拨单名称</td>
        <td>备注</td>
        <td>状态</td>
        <td>添加人</td>
        <td>添加时间</td>
        <td>&nbsp;</td>
      </tr>
      {movingPaper limit=20 pager=pager page=$segment.1 path=$segment.1 order="id desc" shopid_from=$smarty.get.shopid_from shopid_to=$smarty.get.shopid_to title=$smarty.get.title sdate=$smarty.get.sdate edate=$smarty.get.edate paper_id=$smarty.get.paper_id counter=1}
      <tr id="content">
        <td>{$movingPaper.id}</td>
        <td>{$movingPaper.shop_from} -> {$movingPaper.shop_to}</td>
        <td>{$movingPaper.title}</td>
        <td>{$movingPaper.admin_remark}</td>
        <td>
			{if $movingPaper.status=='0'}未审核{/if}
			{if $movingPaper.status=='1'}已审核{/if}
			{if $movingPaper.status=='2'}已确认{/if}
			{if $movingPaper.status=='9'}已入库{/if}
        </td>
        <td>{$movingPaper.create_user}</td>
        <td>{$movingPaper.create_time}</td>
        <td align="right">&nbsp;
        <a id="paper_{$movingPaper.id}" href="javascript:void(0);" onclick="show_moving_paper_sku_list({$movingPaper.id});" act="show">查看</a>
        {if $movingPaper.status=='0'}
        <a href="{$site_admin}m=inventory&s=moving.php&uri=audit&paperId={$movingPaper.id}" onclick="return confirm('审核通过后将不能再删除, 确定?')">审核</a>
        {/if}
        {if $movingPaper.status=='1'}
        <a href="{$site_admin}m=inventory&s=moving.php&paperId={$movingPaper.id}&uri=confirm" onclick="return confirm('确认通过后将不能再编辑, 确定?')">确认</a>
        {/if}
        {if $movingPaper.status<'2'}
        <a href='{$site_admin}m=inventory&s=moving.php&uri=settingProductList&paperId={$movingPaper.id}&{$cond}'><img src="/image/admin/set.png" /></a>
        {/if}
        </td>
      </tr>
      {/movingPaper}
      {if $pager->rows==0}
      <tr id="content">
        <td colspan="20">&nbsp;</td>
      </tr>
      {/if}
    </table>
    <div id="pager" class="mt10">
		{if $pager}共{$pager->rows}条记录 第{$pager->pagecurrent}/{$pager->pages}页 {/if} 		
        {if $pager->current > 1}<a href="{url s1=1}">首页</a>{/if}
        {if $pager->current > 1}<a href="{url s1=$pager->current-1}">上页</a>{/if}
        {if $pager->current < $pager->pages}<a href="{url s1=$pager->current+1}">下页</a>{/if}
        {if $pager->current < $pager->pages}<a href="{url s1=$pager->pages}">尾页</a>{/if}
    </div>
	<p>&nbsp;</p>
</div>
{include file="admin/bottom.php"}
</body>
</html>
